
<%@page import="cn.com.dhcc.app.core.CoreEnv.CoreInitCtx"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<%-- Start of dataTables--%>
<link rel="stylesheet" href="${ctx}/static/css/dataTables/dataTables.fontAwesome.css" />
<link rel="stylesheet" href="${ctx}/static/css/dataTables/dataTables.bootstrap.css" />
<script src="${ctx}/static/js/lib/dataTables/jquery.dataTables.min.js"></script>
<script src="${ctx}/static/js/lib/dataTables/dataTables.bootstrap.js"></script>
<%-- End of dataTables--%>

<script type="text/javascript">
	var listType = '${listType}';
	var timerId; //计时器	
	
	$(function() {
		//根据listType切换标签
		if(listType == "0" || listType == "1" || listType == "2") {
			$('#myTab').children(".active").removeClass("active");
			$('#myTabContent').children(".active").removeClass("in active");
			
			var tabList = $('#myTab').children();
			tabList[listType].classList.add("active");
			$('#myTabContent').children()[listType].classList.add("active");
			
		}
		
		//切换标签后调整iframe高度
		$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
			  parent.setIframeHeight( $('iframe', parent.document)[0] );
			  var type = $(e.target).parent().attr("listType");
			  $('#listType').val(type);
		});
		
		
		$('#listType').val("0");
		
		//倒计时
		timerId = setInterval(function(){ countDown(); },1000);
		/* $('table.table-striped').dataTable({
			language: {
		        "sProcessing": "处理中...",
		        "sLengthMenu": "显示 _MENU_ 项结果",
		        "sZeroRecords": "没有匹配结果",
		        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
		        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
		        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
		        "sInfoPostFix": "",
		        "sSearch": "搜索:",
		        "sUrl": "",
		        "sEmptyTable": "暂无角色信息",
		        "sLoadingRecords": "载入中...",
		        "sInfoThousands": ",",
		        "oPaginate": {
		            "sFirst": "首页",
		            "sPrevious": "上页",
		            "sNext": "下页",
		            "sLast": "末页"
		        },
		        "oAria": {
		            "sSortAscending": ": 以升序排列此列",
		            "sSortDescending": ": 以降序排列此列"
		        }
		    },
		    "pagingType": "full_numbers",
		    "lengthMenu": [ [ 5, 10, 25, 50, 75, 100, -1 ], [ 5, 10, 25, 50, 75, 100, "所有" ] ],
		    "displayLength": 5,
		    "aaSorting": []
		});
		
		dataTableStyle(); */
	});
	
	function deleteById(id) {
		parent.ui.confirm('确认删除?', function() {
			$.ajax({
				type : "POST",
				dataType : "json",
				cache : false,
				url : _ctx + "/task/delete_task.do",
				data : {
					id : id
				},
				success : function(resp) {
					if (resp.status == '1') {
						parent.ui.msg(resp.msg, 1);
						ui.go(_ctx + '/task/task_list.do');
					} else {
						parent.ui.msg(resp.msg, 0);
					}
				},
				error : function() {
					parent.ui.msg('信息加载错误', 0);
				}
			});
		});
	}
	
	function deleteByBatch(){
		/* var isSlected = checkAll.isChecked();
		if(!isSlected){
			ui.msg('请至少选择一条要删除的记录!');
			return;
		}
		var ids = checkAll.getIdsAsArr(); */
		var type = $('#listType').val();
		var ids = new Array();
		if(type == "0") {
			$('#current').find("input:checked:not('#periodCheckedAll')").each(function(index){
				ids.push(this.value);
			});
		} else if(type == "1") {
			$('#ontime_list').find("input:checked:not('#ontimeCheckedAll')").each(function(index){
				ids.push(this.value);
			});
		} else {
			$('#history').find("input:checked:not('#historyCheckedAll')").each(function(index){
				ids.push(this.value);
			});
		}
		
		if(ids.length == 0){
			parent.ui.msg('请至少选择一条要删除的记录!');
			return;
		}
		parent.ui.confirm('确认删除?',function(){
			$.ajax({
				   type: "POST",
				   dataType:"json",
				   cache: false,
				   url: _ctx + "/task/task_deletes.do",
				   traditional: true,
				   data:{ids:ids},
				   success: function(resp){
					   if(resp.status == '1'){
						   parent.ui.msg(resp.msg, 1);
						   ui.go(_ctx + '/task/task_list.do');
					   }else{
						   parent.ui.msg(resp.msg, 0);
					   }
				   },
				   error:function(){
					   parent.ui.msg('信息加载错误', 0);
				   }
			});
		});
	}
	
	function deleteHistory(id) {
		parent.ui.confirm('确认彻底删除任务?', function() {
			$.ajax({
				type : "POST",
				dataType : "json",
				cache : false,
				url : _ctx + "/task/delete_history.do",
				data : {
					id : id
				},
				success : function(resp) {
					if (resp.status == '1') {
						parent.ui.msg(resp.msg, 1);
						ui.go(_ctx + '/task/task_list.do');
					} else {
						parent.ui.msg(resp.msg, 0);
					}
				},
				error : function() {
					parent.ui.msg('信息加载错误', 0);
				}
			});
		});
	}
	
	function deleteHistoryByBatch() {
		var ids = new Array();
		$('#history').find("input:checked:not('#historyCheckedAll')").each(function(index){
			ids.push(this.value);
		});
		
		if(ids.length == 0){
			parent.ui.msg('请至少选择一条要删除的记录!');
			return;
		}
		
		parent.ui.confirm('确认删除?',function(){
			$.ajax({
				   type: "POST",
				   dataType:"json",
				   cache: false,
				   url: _ctx + "/task/history_deletes.do",
				   traditional: true,
				   data:{ids:ids},
				   success: function(resp){
					   if(resp.status == '1'){
						   parent.ui.msg(resp.msg, 1);
						   ui.go(_ctx + '/task/task_list.do');
					   }else{
						   ui.msg(resp.msg, 0);
					   }
				   },
				   error:function(){
					   parent.ui.msg('信息加载错误', 0);
				   }
			});
		});
	}
	
	function excuteImmediate(taskId) {
		parent.ui.confirm('确认立即执行此任务?', function() {
			$.ajax({
				type : "POST",
				dataType : "json",
				cache : false,
				url : _ctx + "/task/execute_ontime_task.do",
				data : {
					id : taskId
				},
				success : function(resp) {
					if (resp.status == '1') {
						parent.ui.msg(resp.msg, 1);
						ui.go(_ctx + '/task/send_task_list.do');
					} else {
						parent.ui.msg(resp.msg, 0);
					}
				},
				error : function() {
					parent.ui.msg('信息加载错误', 0);
				}
			});
		});
	}

	function excutePlay(taskId, status) {
		parent.ui.confirm('确认启动此任务?', function() {
			$.ajax({
				type : "POST",
				dataType : "json",
				cache : false,
				url : _ctx + "/task/update_task_status.do",
				data : {
					id : taskId,
					status : status
				},
				success : function(resp) {
					if (resp.status == '1') {
						parent.ui.msg(resp.msg, 1);
						ui.go(_ctx + '/task/task_list.do');
					} else {
						parent.ui.msg(resp.msg, 0);
					}
				},
				error : function() {
					parent.ui.msg('信息加载错误', 0);
				}
			});
		});
	}

	function excutePause(taskId, status) {
		parent.ui.confirm('确认暂停此任务?', function() {
			$.ajax({
				type : "POST",
				dataType : "json",
				cache : false,
				url : _ctx + "/task/update_task_status.do",
				data : {
					id : taskId,
					status : status
				},
				success : function(resp) {
					if (resp.status == '1') {
						parent.ui.msg(resp.msg, 1);
						ui.go(_ctx + '/task/task_list.do');
					} else {
						parent.ui.msg(resp.msg, 0);
					}
				},
				error : function() {
					parent.ui.msg('信息加载错误', 0);
				}
			});
		});
	}

	function search(form) {
		var currentListType = $('#myTab').children('.active').attr("listType");
		$('#listType').val(currentListType); 
		
		$(form).appendPagerParaStr();
		return true;
	}
	
	function dataTableStyle() {
		/* var width = $($('#historyTable_wrapper').children()[0]).width();
		$($('#historyTable_wrapper').children()[0]).css({'width':width});
		$($('#historyTable_wrapper').children()[2]).css({'width':width}); */
		$('table.table-striped').unwrap();
	}
	
	function countDown() {
		$(".count_down").each(function(index) {
			var endDate = $( this ).attr("value");
			endDate = new Date(endDate);
			var now = new Date(); 
			
			var leftTime=endDate.getTime()-now.getTime(); 
			var leftsecond = parseInt(leftTime/1000);
			var day = Math.floor(leftsecond/(60*60*24)); 
			var hour = Math.floor((leftsecond-day*24*60*60)/3600); 
			var minute = Math.floor((leftsecond-day*24*60*60-hour*3600)/60); 
			var second = Math.floor(leftsecond-day*24*60*60-hour*3600-minute*60);
			
			if(day > 0) {
				$( this ).html("等待>1天");
			} else if (day < 0) {
				$( this ).html("");
			} else {
				$( this ).html(hour+"小时"+minute+"分"+second+"秒");
			}
			
			
			if (hour == 0 && minute == 0 && second == 0) {
				clearInterval(timerId);
			}
		});
	}

    function settTasks(){
        $.ajax({
            type: "POST",
            dataType:"json",
            cache: false,
            url: _ctx + "/task/sett_tasks.do",
            success: function(resp){
                if(resp.status == '1'){
                    ui.msg(resp.msg, 1);
                    ui.go(_ctx + '/task/task_list.do');
                }else{
                    ui.msg(resp.msg, 0);
                }
            },
            error:function(){
                ui.msg('信息加载错误', 0);
            }
        });
    }
</script>
</head>
<body>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> 首页</li>
						<li class="active">ETL任务管理</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-box">
								<div class="widget-header widget-header-flat">
									<h5 class="smaller lighter">
										<i class="icon-list"></i> &nbsp;
									</h5>
								</div>
								
								<div class="widget-body">
									<div class="widget-main">
									  	<form  id="searchForm"  class="form-search"  action="${ctx}/task/task_list.do?"  method="post" onsubmit="return search(this)">
										  <div class="row">
											    <div class="col-xs-4">
													<div class="input-group">
													    <span class="input-group-addon">任务名称</span>
													    <input type=hidden name='listType' id='listType'/>
													    <input type="text" class="form-control search-query" id="task_search" name="task"  value="${param.task}"/>
													    <span class="input-group-btn">
															<button type="submit" class="btn btn-purple btn-sm">
																<i class="icon-search icon-on-right bigger-110"></i>
																搜索
															</button>
														</span>
												   </div>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>

							<div class="hr hr12 hr-dotted"></div>

							<div class="tabbable">
								<ul class="nav nav-tabs" id="myTab">
									<li class="active" listType="0"><a data-toggle="tab" href="#current">
											周期性任务 </a></li>
											
									<li listType="1"><a data-toggle="tab" href="#ontime_list">
											一次性任务 </a></li>		

									<li listType="2"><a data-toggle="tab" href="#history"> 历史任务列表 </a></li>
								</ul>

								<div class="tab-content" id="myTabContent">
									<div id="current" class="tab-pane in active">

										<!-- <div class="row">
											<div class="col-sm-12">
												<div class="widget-box transparent">
													<div class="widget-header widget-header-flat">
														<h6 class="lighter">
															&nbsp;&nbsp;<i class="icon-refresh bigger-120"></i>周期性任务
														</h6>
													</div>
												</div>
											</div>
										</div> -->
										<!-- <div class="row">
											<div class="table-responsive">
												
											</div>
										</div> -->
										
										<div class="table-responsive">
										
												<span class="input-group-btn">
													<!--
													<a class="btn btn-danger btn-sm"
                                                       href="javascript:void(0)" onclick="settTasks();"><i
															class="icon-plus-sign icon-on-right"></i> 结算&nbsp;&nbsp;</a>-->
													<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
													<a name="notAdminButton" class="btn btn-primary btn-sm"
														href="${ctx}/task/task_add.do?taskType=2"><i
														class="icon-plus-sign icon-on-right"></i> 添加&nbsp;&nbsp;</a>
													<a class="btn btn-danger btn-sm" href="javascript:void(0)" 
													   style="margin-left:10px;" onclick="deleteByBatch()">
														<i class="icon-trash icon-on-right"></i> 批量删除&nbsp;
													</a>
													</c:if>
												</span>
												<br>
												
											<table class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center nosort" style="padding-right: 8px;" data-orderable="false">
															<label>
															<input type="checkbox" class="ace" id="periodCheckedAll"/>
															<span class="lbl"></span>
															</label>
														</th>
														<th>任务名称</th>
														<th>频率</th>
														<th>最后修改时间</th>
														<th>上次执行开始时间</th>
														<th>上次执行完成时间</th>
														<th>任务状态</th>
														<th>上次执行结果</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													<c:forEach var="vo" items="${periodList}"
														varStatus="varStatus">
														<tr>
															<td class="center">
																<label>
																<input type="checkbox" class="ace" value="${vo.id}"/>
																<span class="lbl"></span>
																</label>
															</td>
															<td><nobr>${vo.taskName}</nobr></td>
															<td>${app:ctname("FREQ_TYPE",vo.freq) }<c:if
																	test="${ vo.freq eq 1}">
																	<fmt:formatNumber type="number"
																		value="${vo.intervalVallue/60 }" maxFractionDigits="2" />&nbsp;分钟(${vo.intervalVallue }&nbsp;秒)
															</c:if> <c:if test="${ vo.freq eq 3}">
																(${app:ctname("WEEK_TYPE",vo.intervalVallue) })
															</c:if>
															</td>
															<td><fmt:formatDate value="${vo.mtime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td><fmt:formatDate value="${vo.executeBeginTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td><fmt:formatDate value="${vo.executeEndTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td>${app:ctname("TASK_STATUS",vo.status) }
																<c:choose>
																	<c:when test="${vo.count ==0 || empty vo.count}">
																	(尚未执行过 )
																	</c:when>
																	<c:when test="${vo.count == vo.successCount}">
																	(已经执行${vo.count}次, 成功${vo.successCount}次)
																	</c:when>
																	<c:otherwise>
																	(已经执行${vo.count}次, 成功${vo.successCount}次, 失败${vo.count - vo.successCount}次)
																	</c:otherwise>
																</c:choose>
																
																<%-- <c:if test="${vo.count ==0 || empty vo.count}">(尚未执行过 )</c:if> 
																<c:if
																	test="${vo.count!=0 && vo.count != vo.successCount && !empty vo.count}">(已经执行${vo.count}次, 成功${vo.successCount}次, 失败${vo.count - vo.successCount}次)</c:if>
																<c:if
																	test="${vo.count!=0 && vo.count == vo.successCount}">(已经执行${vo.count}次, 成功${vo.successCount}次)</c:if> --%>
															</td>
															<td>
																<c:if test="${vo.lastLogStatus ==0}">失败</c:if>
																<c:if test="${vo.lastLogStatus ==1}">成功</c:if>
															</td>
															<td>
																<div
																	class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
																	<a class="blue"
																	   href="${ctx }/task/task_get.do?id=${vo.id}"
																	   title="查看"> <i class="icon-zoom-in bigger-130"></i>
																	</a>
																	<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
																	<c:if test="${vo.status eq '1'}">
																		<a name="notAdminButton" class="red"
																			href="javascript:void(0);"
																			onclick="excutePlay('${vo.id}',2)" title="启动"> <i
																			class="icon-play bigger-130"></i>
																		</a>
																		<a name="notAdminButton" class="green"
																			href="${ctx }/task/task_update.do?id=${vo.id}&taskType=2"
																			title="修改"> <i class="icon-pencil bigger-130"></i>
																		</a>
																		<a name="notAdminButton" class="red"
																			href="javascript:void(0);"
																			onclick="deleteById('${vo.id }')" title="删除"> <i
																			class="icon-trash bigger-130"></i>
																		</a>
																	</c:if>
																	<c:if test="${vo.status eq '2' || vo.status eq '5'}">
																		<a name="notAdminButton" class="blue"
																			href="javascript:void(0);"
																			onclick="excutePause('${vo.id}',1)" title="暂停"> <i
																			class="icon-pause bigger-130"></i>
																		</a>
																	</c:if>
																	</c:if>
																	<p>

																		<a class="green"
																			href="${ctx }/task/task_log_list.do?id=${vo.id}"
																			title="监控 "> <i class="icon-tasks bigger-130"></i>
																		</a>
																</div>
															</td>
														</tr>
													</c:forEach>
												</tbody>
											</table>
											<jsp:include page="/WEB-INF/view/common/tab_pg.jsp">
												<jsp:param value="${ctx}/task/task_list.do"
													name="url" />
												<jsp:param value="${periodTotal}" name="total" />
												<jsp:param value="${_urlpara}" name="urlpara" />
												<jsp:param value="0" name="pagerListType" />
												<jsp:param value="${ontimeOffSet}" name="offSet1" />
												<jsp:param value="${historyOffSet}" name="offSet2" />
											</jsp:include>
										</div>
										<!-- <div class="hr hr12 hr-dotted"></div>
										<div class="row">
											<div class="col-sm-12">
												<div class="widget-box transparent">
													<div class="widget-header widget-header-flat">
														<h6 class="lighter">
															&nbsp;&nbsp;<i class="icon-arrow-right"></i>一次性任务
														</h6>
													</div>
												</div>
											</div>
										</div> -->
										




									</div>
									
									<div id="ontime_list" class="tab-pane">
										<div class="table-responsive">
												<span class="input-group-btn">
													<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
													<a name="notAdminButton" class="btn btn-primary btn-sm"
														href="${ctx}/task/task_add.do?taskType=1" ><i
														class="icon-plus-sign icon-on-right"></i> 添加&nbsp;&nbsp;</a>
													<a class="btn btn-danger btn-sm" href="javascript:void(0)" 
													   style="margin-left:10px;" onclick="deleteByBatch()">
														<i class="icon-trash icon-on-right"></i> 批量删除&nbsp;
													</a>
													</c:if>
												</span>
												<br>
											<table class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center nosort" style="padding-right: 8px;" data-orderable="false">
															<label>
															<input type="checkbox" class="ace" id="ontimeCheckedAll"/>
															<span class="lbl"></span>
															</label>
														</th>
														<th>任务名称</th>
														<th>执行类型</th>
														<th>最后修改时间</th>
														<th>执行开始时间</th>
														<th>执行结束时间</th>
														<th>任务状态</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													<c:forEach var="vo" items="${onTimeList}"
														varStatus="varStatus">
														<tr>
															<td class="center">
																<label>
																<input type="checkbox" class="ace" value="${vo.id}"/>
																<span class="lbl"></span>
																</label>
															</td>
															<td><nobr>${vo.taskName}</nobr></td>
															<td>${app:ctname("EXECUTE_TYPE",vo.executeType)}</td>
															<td><fmt:formatDate value="${vo.mtime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<c:choose>
															<c:when test="${!empty(vo.executeTime) && vo.status == 1}">
																<td class="count_down" value="${vo.executeTime}">${vo.executeTime}</td>
															</c:when>
															<c:otherwise>
																<td><fmt:formatDate value="${vo.executeBeginTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															</c:otherwise>
															</c:choose>
															
															<td><fmt:formatDate value="${vo.executeEndTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td>${app:ctname("TASK_STATUS",vo.status) }</td>
															<td>
																<div
																	class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
																	<a class="blue"
																		href="${ctx }/task/task_get.do?id=${vo.id}" title="查看">
																		<i class="icon-zoom-in bigger-130"></i>
																	</a>
																	<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
																	<a name="notAdminButton" class="red"
																		href="javascript:void(0);"
																		onclick="deleteById('${vo.id }')" title="删除"> <i
																		class="icon-trash bigger-130"></i>
																	</a>
																	<c:if test="${vo.status=='1'||vo.status=='4'}">
																		<a name="notAdminButton" class="green"
																			href="${ctx }/task/task_update.do?id=${vo.id}&taskType=1"
																			title="修改"> <i class="icon-pencil bigger-130"></i>
																		</a>
																		<c:if test="${vo.executeType=='3'}">
																			<a name="notAdminButton" class="red"
																				href="javascript: excutePlay('${vo.id}',2);"
																				title="启动"> <i class="icon-play bigger-130"></i>
																			</a>
																		</c:if>
																		<c:if test="${vo.executeType=='1' || vo.executeType=='2'}">
																			<a name="notAdminButton" class="red"
																				href="javascript:excutePlay('${vo.id}',2);"
																				title="启动"> <i class="icon-play bigger-130"></i>
																			</a>
																		</c:if>
																	</c:if>
																	</c:if>
																	<c:if test="${vo.status eq '3' || vo.status eq '5' }">
																		<a class="green"
																			href="${ctx }/task/task_log_list.do?id=${vo.id}"
																			title="监控 "> <i class="icon-tasks bigger-130"></i>
																		</a>
																	</c:if>
																</div>
															</td>
														</tr>
													</c:forEach>
												</tbody>
											</table>
											<jsp:include page="/WEB-INF/view/common/tab_pg.jsp">
												<jsp:param value="${ctx}/task/task_list.do"
													name="url" />
												<jsp:param value="${ontimeTotal}" name="total" />
												<jsp:param value="${_urlpara}" name="urlpara" />
												<jsp:param value="1" name="pagerListType" />
												<jsp:param value="${periodOffSet}" name="offSet1" />
												<jsp:param value="${historyOffSet}" name="offSet2" />
											</jsp:include>
										</div>
									</div>

									<div id="history" class="tab-pane">
										<div class="table-responsive">
										
												<span class="input-group-btn">
													<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
													<a class="btn btn-danger btn-sm" href="javascript:void(0)" onclick="deleteHistoryByBatch();">
														<i class="icon-trash icon-on-right"></i> 批量删除&nbsp;
													</a>
													</c:if>
												</span>
												<br>
												
											<table id="historyTable" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center nosort" style="padding-right: 8px;" data-orderable="false">
															<label>
															<input type="checkbox" class="ace" id="historyCheckedAll"/>
															<span class="lbl"></span>
															</label>
														</th>
														<th>任务名称</th>
														<th>任务类型</th>
														<th>最后修改时间</th>
														<th>上次执行开始时间</th>
														<th>上次执行结束时间</th>
														<th>上次执行结果</th>
														<th>任务状态</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													<c:forEach var="vo" items="${historyList}" varStatus="varStatus">
														<tr>
															<td class="center">
																<label>
																<input type="checkbox" class="ace" value="${vo.id}"/>
																<span class="lbl"></span>
																</label>
															</td>
															<td><nobr>${vo.taskName}</nobr></td>
															<td>${app:ctname("TASK_FREQ_TYPE",vo.taskFreqType) }</td>
															<td><fmt:formatDate value="${vo.mtime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td><fmt:formatDate value="${vo.executeBeginTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td><fmt:formatDate value="${vo.executeEndTime}"
																	pattern="yyyy-MM-dd HH:mm:ss" /></td>
															<td>
																<c:if test="${vo.lastLogStatus ==0}">失败</c:if>
																<c:if test="${vo.lastLogStatus ==1}">成功</c:if>
															</td>
															<td><c:if test="${vo.taskFreqType=='1' && !empty(vo.count)}">
															                执行完成
															    </c:if> 
															    <c:if test="${vo.taskFreqType=='2' && !empty(vo.count)}">
															       	执行完成 (已经执行${vo.count}次 ) 
															    </c:if>
															    <c:if test="${empty(vo.count)}">
															       	尚未执行
															    </c:if>
															</td>
															<td>
																<a  class="green"
																	href="${ctx }/task/task_log_list.do?id=${vo.id}&listType=0"
																	title="监控 "> <i class="icon-tasks bigger-130"></i>

																</a>
																<c:if test="${sessionScope._user_session.loginUser.superAdmin || currentUser.ext1 eq 1}">
																<a name="notAdminButton" class="red"
																		href="javascript:void(0);"
																		onclick="deleteHistory('${vo.id }')" title="删除"> <i
																	class="icon-trash bigger-130"></i>
																</a>
																</c:if>
															</td>
														</tr>
													</c:forEach>
												</tbody>
											</table>
											<jsp:include page="/WEB-INF/view/common/tab_pg.jsp">
												<jsp:param value="${ctx}/task/task_list.do"
													name="url" />
												<jsp:param value="${historyTotal}" name="total" />
												<jsp:param value="${_urlpara}" name="urlpara" />
												<jsp:param value="2" name="pagerListType" />
												<jsp:param value="${periodOffSet}" name="offSet1" />
												<jsp:param value="${ontimeOffSet}" name="offSet2" />
											</jsp:include>
										</div>


									</div>
								</div>
							</div>

						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
